﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using ActionPluginAPI;
using System.Xml.Serialization;
using iMapa.Backend.ActionPlugin;

namespace iMapa.Backend
{
    [Serializable]
    public class InteractObject
    {
        private Point position;
        private String name;
        private int radius;
        private string actionType;
        private string actionParamsFile;
        private IActionParameters actionParams;

        private string parent;

        public InteractObject()
        {
            this.Position = new Point();
        }
        
        public Point Position
        {
            get { return position; }
            set { position = value; }
        }

        [XmlAttributeAttribute()]
        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        [XmlAttributeAttribute()]
        public int Radius
        {
            get { return radius; }
            set { radius = value; }
        }

        [XmlIgnoreAttribute()]
        public IActionParameters ActionParams
        {
            get { return actionParams;  }
            set {
                actionParams = value;
                actionParamsFile = value == null ? actionParamsFile : value.GetID();
            }
        }

        [XmlIgnoreAttribute()]
        public string MapName
        {
          get { return parent; }
          set { parent = value; }
        }

        [XmlAttributeAttribute()]
        public string ActionParamsFile
        {
            get
            {
                return actionParamsFile;
            }
            set
            {
                actionParamsFile= value;
            }
        }

        [XmlAttributeAttribute()]
        public string ActionType
        {
            get { return actionType; }
            set { actionType = value; }
        }
    }
}
